let question = {
    state: {
        questionTypeList: [
            { text: "单选题", status: "1" },
            { text: "多选题", status: "2" },
            { text: "判断题", status: "3" },
            { text: "不定项", status: "4" },
            { text: "填空题", status: "5" },
            { text: "简答题", status: "6" },
            { text: "材料题", status: "7" }
        ],

        bank_id: sessionStorage.getItem("bank_id"),//试题id
        subject_id: sessionStorage.getItem("subject_id"),//科目id
        exam_id: sessionStorage.getItem("exam_id"),//试题id
        papers_id: sessionStorage.getItem("papers_id"),//试卷id(只有模拟真题时需要传递)
        type: sessionStorage.getItem("type"),//类型(1章节练习2快速做题3模拟真题)
        model: sessionStorage.getItem("model"),//类型(1章节练习2快速做题3模拟真题)
        chapter_id: sessionStorage.getItem("chapter_id"),
        joint_id: sessionStorage.getItem("joint_id"),

        subject_List: sessionStorage.getItem("subject_List"),//科目list
        zjList: sessionStorage.getItem('zjList'),//type1 章节list

        question_type: sessionStorage.getItem("question_type") || '[1]', //题型
        exam_type: sessionStorage.getItem("exam_type") || 1, //分类,
        exam_count: sessionStorage.getItem("exam_count") || 1, //题量,

        startTime: sessionStorage.getItem("startTime"),//开始答题时间
        titleName: sessionStorage.getItem("titleName"),//开始答题时间

        exerciseTab: sessionStorage.getItem("exerciseTab"),//答题tab Index
    },
    mutations: {
        bank_id(state, str) {
            state.bank_id = str;
            sessionStorage.setItem("bank_id", str);
        },
        subject_id(state, str) {
            state.subject_id = str;
            sessionStorage.setItem("subject_id", str);
        },
        exam_id(state, str) {
            state.exam_id = str;
            sessionStorage.setItem("exam_id", str);
        },
        papers_id(state, str) {
            state.papers_id = str;
            sessionStorage.setItem("papers_id", str);
        },
        type(state, str) {
            state.type = str;
            sessionStorage.setItem("type", str);
        },
        model(state, str) {
            state.model = str;
            sessionStorage.setItem("model", str);
        },


        chapter_id(state, str) {
            state.chapter_id = str;
            sessionStorage.setItem("chapter_id", str);
        },
        joint_id(state, str) {
            state.joint_id = str;
            sessionStorage.setItem("joint_id", str);
        },

        clearZhangJie(state) {
            let arr = ['questionTypeList'];
            for (let item in state) {
                if (arr.indexOf(item) == -1) {
                    state[item] = null;
                    sessionStorage.removeItem(item);
                }
            }
        },


        subject_List(state, str) {
            state.subject_List = str;
            sessionStorage.setItem("subject_List", str);
        },
        zjList(state, str) {
            state.zjList = str;
            sessionStorage.setItem("zjList", str);
        },

        question_type(state, str) {
            state.question_type = str;
            sessionStorage.setItem("question_type", str);
        },
        exam_type(state, str) {
            state.exam_type = str;
            sessionStorage.setItem("exam_type", str);
        },
        exam_count(state, str) {
            state.exam_count = str;
            sessionStorage.setItem("exam_count", str);
        },
        startTime(state, str) {
            state.startTime = str;
            sessionStorage.setItem("startTime", str);
        },
        titleName(state, str) {
            state.titleName = str;
            sessionStorage.setItem("titleName", str);
        },
        exerciseTab(state, str) {
            state.exerciseTab = str;
            sessionStorage.setItem("exerciseTab", str);
        }

    }
}


export default question;